//
//  meSettingFeedBackChat.swift
//  DingDongZP
//
//  Created by Zhongnan on 16/5/14.
//  Copyright © 2016年 iyhjiang.com. All rights reserved.
//

import UIKit
//import RongIMKit

class meSettingFeedBackChat: RCConversationViewController {

    override init!(conversationType: RCConversationType, targetId: String!) {
        
        super.init(conversationType: conversationType, targetId: targetId)
    }
    
    override init(nibName nibNameOrNil: String?, bundle nibBundleOrNil: NSBundle?) {
        super.init(nibName: nibNameOrNil, bundle: nibBundleOrNil)
    }
    
    override func setMessageAvatarStyle(avatarStyle: RCUserAvatarStyle) {
//        super.setMessageAvatarStyle(avatarStyle)
        RCIM.sharedRCIM().globalMessageAvatarStyle = RCUserAvatarStyle.USER_AVATAR_CYCLE;
        
    }
    
    override func viewDidLoad() {
       
        super.viewDidLoad()
        title = targetId
        setMessageAvatarStyle(.USER_AVATAR_CYCLE)

        conversationMessageCollectionView.contentInset = UIEdgeInsetsMake(64 + 30, 0, 0, 0)
        self.defaultInputType = RCChatSessionInputBarInputType.Text
        self.chatSessionInputBarControl.pluginBoardView.removeItemAtIndex(2)
        
    }
    
    override func viewDidDisappear(animated: Bool) {
        
    }
    
    override func didLongPressCellPortrait(userId: String!) {
        
        super.didLongPressCellPortrait(userId)
    }
    
    override func scrollViewDidScroll(scrollView: UIScrollView) {
        
        super.scrollViewDidScroll(scrollView)

    }
    
//    override func sendMessage(messageContent: RCMessageContent!, pushContent: String!) {
//        
//    }
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
//    override func customerServiceLeftCurrentViewController() {
//        super.customerServiceLeftCurrentViewController()
//    }
    
//    deinit {
//        customerServiceLeftCurrentViewController()
//    }
}

extension meSettingFeedBackChat {
    
    func allMethods() {
        
        var count: UInt32 = 0
        let methods = class_copyMethodList(RCConversationViewController.self, &count)
        
        for i in 0 ..< Int(count) {
            let method = methods[i]
            let sel = method_getName(method)
            let methodName = sel_getName(sel)
            let argument = method_getNumberOfArguments(method)
            
            let str = String.fromCString(methodName)
            print("name: \(methodName), arguemtns: \(argument)",str)
            print(str)
        }
    }
}